<!doctype html>
<html lang="zh-cn">
<head>
{% include "tdm_include_head_template.html" %}

<script type="text/javascript">
$(function() {
});
</script>

</head>

<body class=" theme-blue">
{% include "tdm_include_navbar_template.html" %}

<div class="sidebar-nav">
  <ul id="city_jxd">
  {% for city in jxd_list_all %}
  <li>
    <a href="#" data-target=".{{city.name}}-menu" class="nav-header collapsed" data-toggle="collapse" aria-expanded="false">
      <i class="fa fa-fw fa-bars"></i>
      {{city.name}}
      {% if city.net_warn_nr %}
      <span class="badge badge-warning">{{city.net_warn_nr}}</span>
      {% endif %}
      {% if city.net_alert_nr %}
      <span class="badge badge-danger">{{city.net_alert_nr}}</span>
      {% endif %}
      <i class="fa fa-collapse"></i>
    </a>
  </li>
  <li>
    <ul class="{{city.name}}-menu nav nav-list collapse {% ifequal view_city city.name %}in{% endifequal %}">
      {% for jxd in city.jxd_list %}
      <li>
        <a href="/tdm/mdm/{{city.name}}/{{jxd.name}}">
          <span class="fa fa-caret-right"></span>
          {{jxd.name}}
          {% if jxd.warning_nr %}
          <div class="pull-right">
            <span class="badge badge-warning">{{jxd.warning_nr}}</span>
          </div>
          {% endif %}
          {% if jxd.alert_nr %}
          <div class="pull-right">
            <span class="badge badge-danger">{{jxd.alert_nr}}</span>
          </div>
          {% endif %}
        </a>
      </li>
      {% endfor %}
    </ul>
  </li>
  {% endfor %}
  </ul>
</div>

<div class="content">
  <div class="header">
    <a class="btn btn-primary btn-jxd" rol="button" href="/tdm/mdm/{{view_city}}/{{view_jxd}}/">
      <span class="glyphicon glyphicon-circle-arrow-left"></span>
      {{view_city}} - {{view_jxd}} - {{classroom}}
    </a>
    <ul class="nav nav-tabs" role="tablist">
      {% for cr in classroom_info_list %}
      <li role="presentation" {% ifequal cr.name classroom %}class="active"{% endifequal %}>
        <a href="/tdm/mdm/{{view_city}}/{{view_jxd}}/{{cr.name}}">{{cr.name}}
        {% if cr.warning_nr %}
        <span class="badge badge-warning">{{cr.warning_nr}}</span>
        {% endif %}
        {% if cr.alert_nr %}
        <span class="badge badge-danger">{{cr.alert_nr}}</span>
        {% endif %}
        </a>
      </li>
      {% endfor %}
    </ul>
  </div>
  <div class="table-responsive">
    <table class="table table-hover">
      <tr>
        <th>MAC地址</th>
        <th>IP地址</th>
        <th>最后时间</th>
        <th>电池</th>
        <th>上电时间</th>
        <th>内存</th>
        <th>存储</th>
        <th>无线信号</th>
        <th>固件版本</th>
        <th>设备型号</th>
      </tr>
      {% for mdm_info1 in mdm_info_list %}
      <tr>
        <td>{{mdm_info1.macaddr}}</td>
        <td>{{mdm_info1.ipaddr}}</td>
        <td><script>sec2date({{mdm_info1.lasttime}});</script></td>
        <td>{{mdm_info1.battery}}%</td>
        <td>{{mdm_info1.uptime}}</td>
        <td>{{mdm_info1.memory}}</td>
        <td>{{mdm_info1.storage}}</td>
        <td>{{mdm_info1.wifistrength}}</td>
        <td>{{mdm_info1.fmver}}</td>
        <td>{{mdm_info1.devtype}}</td>
      </tr>
      {% endfor %}
      {% if mdm_info_list|length_is:"0" %}
      <tr><td colspan="11" align="center">无设备</td></tr>
      {% endif %}
    </table>
  </div>

  {% include "tdm_include_footer_template.html" %}
</div>
</body>
</html>